/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package callable;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.concurrent.Callable;

/**
 *
 * @author FERRETERIA
 */
public class HacerConsulta2 implements Callable<Integer> {
        private String sql;
        private Connection conexion;

        public HacerConsulta2(Connection conexion,String sql){
            this.sql = sql;
            this.conexion = conexion;
        }
        
        public Integer call() throws Exception {
            // Preparamos la consulta 
            PreparedStatement pstm = conexion.prepareStatement(sql); 
            pstm.execute ();
            pstm.close();
            return 0;
        }             
}
